#ifndef __CRIT_SECT_WRAP_H
#define __CRIT_SECT_WRAP_H

#include <windows.h>

class CritSectionWrapper
{
public:
  CritSectionWrapper() { InitializeCriticalSection(&m_CriticalSection); }
  ~CritSectionWrapper() { DeleteCriticalSection(&m_CriticalSection); }
  void Acquire() { EnterCriticalSection(&m_CriticalSection); }
  void Release() { LeaveCriticalSection(&m_CriticalSection); }

private:
  CRITICAL_SECTION m_CriticalSection;              // Synchronization object
};

#endif //__CRIT_SECT_WRAP_H